package com.preknow.lianxi;

public class Student {

    String neme;
    int emp;
    int score;

    public String getNeme() {
        return neme;
    }

    public void setNeme(String neme) {
        this.neme = neme;
    }

    public int getEmp() {
        return emp;
    }

    public void setEmp(int emp) {
        this.emp = emp;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public Student(String neme, int emp, int score){
        this.neme = neme;
        this.emp = emp;
        this.score = score;
    }

    public void xainshi(){
        System.out.println(neme+"--"+emp+"--"+score);
    }

    public static void ss(Student[] st){
        Student m;
        for(int i=0;i<st.length;i++){
            for(int j=0;j < st.length-i-1;j++){
                if(st[j].score<st[j+1].score){
                    m = st[j];
                    st[j]=st[j+1];
                    st[j+1]=m;
                }
            }
        }
    }

    public static void main(String[] args) {
        Student[] st = new Student[2];
        st[0] = new Student("zhanagsan",13,68);
        st[1] = new Student("lisi",15,88);
        Student.ss(st);
        for (Student m:st) {
            m.xainshi();
        }
    }
}
